/*
 * Copyright 2017 hv0912
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.vimhe.ezimp2.handler.bean;

import java.io.Serializable;
import java.util.Objects;

/**
 * 单元格数据
 *
 * @author Vimhe
 */
public final class CellData implements Serializable {

    private String fileIndex;
    private Integer sheetIndex;
    private Integer rowIndex;
    private String cellIndex;
    private Object value;

    public CellData(String fileIndex, Integer sheetIndex, Integer rowIndex, String cellIndex) {
        this.fileIndex = fileIndex;
        this.sheetIndex = sheetIndex;
        this.rowIndex = rowIndex;
        this.cellIndex = cellIndex;
    }

    public String getFileIndex() {
        return fileIndex;
    }

    public void setFileIndex(String fileIndex) {
        this.fileIndex = fileIndex;
    }

    public Integer getSheetIndex() {
        return sheetIndex;
    }

    public void setSheetIndex(Integer sheetIndex) {
        this.sheetIndex = sheetIndex;
    }

    public Integer getRowIndex() {
        return rowIndex;
    }

    public void setRowIndex(Integer rowIndex) {
        this.rowIndex = rowIndex;
    }

    public String getCellIndex() {
        return cellIndex;
    }

    public void setCellIndex(String cellIndex) {
        this.cellIndex = cellIndex;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    @Override
    public int hashCode() {
        return Objects.hash(fileIndex, sheetIndex, rowIndex, cellIndex);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CellData cellData = (CellData) o;
        return Objects.equals(fileIndex, cellData.fileIndex) &&
                Objects.equals(sheetIndex, cellData.sheetIndex) &&
                Objects.equals(rowIndex, cellData.rowIndex) &&
                Objects.equals(cellIndex, cellData.cellIndex);
    }

    @Override
    public String toString() {
        return "CellData{" +
                "fileIndex='" + fileIndex + '\'' +
                ", sheetIndex=" + sheetIndex +
                ", rowIndex=" + rowIndex +
                ", cellIndex='" + cellIndex + '\'' +
                '}';
    }

}
